package org.insia.smartposse.mapping.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the users table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="users"
 */

public abstract class BaseUsers  implements Serializable {

	public static String REF = "Users";
	public static String PROP_AVATAR = "Avatar";
	public static String PROP_BIRTHDAY = "Birthday";
	public static String PROP_MANAGER = "Manager";
	public static String PROP_WEBSITE = "Website";
	public static String PROP_SALARY = "Salary";
	public static String PROP_LOGIN = "Login";
	public static String PROP_LANGUAGE = "Language";
	public static String PROP_PASSWORD = "Password";
	public static String PROP_EMAIL = "Email";
	public static String PROP_DESCRIPTION = "Description";
	public static String PROP_FIRST_NAME = "FirstName";
	public static String PROP_EMAIL_ANONYME = "EmailAnonyme";
	public static String PROP_FREELANCE = "Freelance";
	public static String PROP_ID = "Id";
	public static String PROP_LAST_NAME = "LastName";


	// constructors
	public BaseUsers () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUsers (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseUsers (
		java.lang.Integer id,
		java.util.Date birthday,
		double salary,
		boolean emailAnonyme,
		boolean freelance,
		boolean manager) {

		this.setId(id);
		this.setBirthday(birthday);
		this.setSalary(salary);
		this.setEmailAnonyme(emailAnonyme);
		this.setFreelance(freelance);
		this.setManager(manager);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String login;
	private java.lang.String password;
	private java.lang.String firstName;
	private java.lang.String lastName;
	private java.util.Date birthday;
	private java.lang.String email;
	private java.lang.String website;
	private java.lang.String description;
	private java.lang.String avatar;
	private double salary;
	private java.lang.String language;
	private boolean emailAnonyme;
	private boolean freelance;
	private boolean manager;

	// collections
	private java.util.Set<org.insia.smartposse.mapping.Application> freelanceApplicationList;
	private java.util.Set<org.insia.smartposse.mapping.FreelanceBooks> freelanceBooksList;
	private java.util.Set<org.insia.smartposse.mapping.FreelanceSkills> freelanceSkillsList;
	private java.util.Set<org.insia.smartposse.mapping.Projects> projectList;
	private java.util.Set<org.insia.smartposse.mapping.JobProject> jobProjectList;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: login
	 */
	public java.lang.String getLogin () {
		return login;
	}

	/**
	 * Set the value related to the column: login
	 * @param login the login value
	 */
	public void setLogin (java.lang.String login) {
		this.login = login;
	}



	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword () {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * @param password the password value
	 */
	public void setPassword (java.lang.String password) {
		this.password = password;
	}



	/**
	 * Return the value associated with the column: first_name
	 */
	public java.lang.String getFirstName () {
		return firstName;
	}

	/**
	 * Set the value related to the column: first_name
	 * @param firstName the first_name value
	 */
	public void setFirstName (java.lang.String firstName) {
		this.firstName = firstName;
	}



	/**
	 * Return the value associated with the column: last_name
	 */
	public java.lang.String getLastName () {
		return lastName;
	}

	/**
	 * Set the value related to the column: last_name
	 * @param lastName the last_name value
	 */
	public void setLastName (java.lang.String lastName) {
		this.lastName = lastName;
	}



	/**
	 * Return the value associated with the column: birthday
	 */
	public java.util.Date getBirthday () {
		return birthday;
	}

	/**
	 * Set the value related to the column: birthday
	 * @param birthday the birthday value
	 */
	public void setBirthday (java.util.Date birthday) {
		this.birthday = birthday;
	}



	/**
	 * Return the value associated with the column: email
	 */
	public java.lang.String getEmail () {
		return email;
	}

	/**
	 * Set the value related to the column: email
	 * @param email the email value
	 */
	public void setEmail (java.lang.String email) {
		this.email = email;
	}



	/**
	 * Return the value associated with the column: website
	 */
	public java.lang.String getWebsite () {
		return website;
	}

	/**
	 * Set the value related to the column: website
	 * @param website the website value
	 */
	public void setWebsite (java.lang.String website) {
		this.website = website;
	}



	/**
	 * Return the value associated with the column: description
	 */
	public java.lang.String getDescription () {
		return description;
	}

	/**
	 * Set the value related to the column: description
	 * @param description the description value
	 */
	public void setDescription (java.lang.String description) {
		this.description = description;
	}



	/**
	 * Return the value associated with the column: avatar
	 */
	public java.lang.String getAvatar () {
		return avatar;
	}

	/**
	 * Set the value related to the column: avatar
	 * @param avatar the avatar value
	 */
	public void setAvatar (java.lang.String avatar) {
		this.avatar = avatar;
	}



	/**
	 * Return the value associated with the column: salary
	 */
	public double getSalary () {
		return salary;
	}

	/**
	 * Set the value related to the column: salary
	 * @param salary the salary value
	 */
	public void setSalary (double salary) {
		this.salary = salary;
	}



	/**
	 * Return the value associated with the column: language
	 */
	public java.lang.String getLanguage () {
		return language;
	}

	/**
	 * Set the value related to the column: language
	 * @param language the language value
	 */
	public void setLanguage (java.lang.String language) {
		this.language = language;
	}



	/**
	 * Return the value associated with the column: email_anonyme
	 */
	public boolean isEmailAnonyme () {
		return emailAnonyme;
	}

	/**
	 * Set the value related to the column: email_anonyme
	 * @param emailAnonyme the email_anonyme value
	 */
	public void setEmailAnonyme (boolean emailAnonyme) {
		this.emailAnonyme = emailAnonyme;
	}



	/**
	 * Return the value associated with the column: freelance
	 */
	public boolean isFreelance () {
		return freelance;
	}

	/**
	 * Set the value related to the column: freelance
	 * @param freelance the freelance value
	 */
	public void setFreelance (boolean freelance) {
		this.freelance = freelance;
	}



	/**
	 * Return the value associated with the column: manager
	 */
	public boolean isManager () {
		return manager;
	}

	/**
	 * Set the value related to the column: manager
	 * @param manager the manager value
	 */
	public void setManager (boolean manager) {
		this.manager = manager;
	}



	/**
	 * Return the value associated with the column: FreelanceApplicationList
	 */
	public java.util.Set<org.insia.smartposse.mapping.Application> getFreelanceApplicationList () {
		return freelanceApplicationList;
	}

	/**
	 * Set the value related to the column: FreelanceApplicationList
	 * @param freelanceApplicationList the FreelanceApplicationList value
	 */
	public void setFreelanceApplicationList (java.util.Set<org.insia.smartposse.mapping.Application> freelanceApplicationList) {
		this.freelanceApplicationList = freelanceApplicationList;
	}

	public void addToFreelanceApplicationList (org.insia.smartposse.mapping.Application application) {
		if (null == getFreelanceApplicationList()) setFreelanceApplicationList(new java.util.TreeSet<org.insia.smartposse.mapping.Application>());
		getFreelanceApplicationList().add(application);
	}



	/**
	 * Return the value associated with the column: FreelanceBooksList
	 */
	public java.util.Set<org.insia.smartposse.mapping.FreelanceBooks> getFreelanceBooksList () {
		return freelanceBooksList;
	}

	/**
	 * Set the value related to the column: FreelanceBooksList
	 * @param freelanceBooksList the FreelanceBooksList value
	 */
	public void setFreelanceBooksList (java.util.Set<org.insia.smartposse.mapping.FreelanceBooks> freelanceBooksList) {
		this.freelanceBooksList = freelanceBooksList;
	}

	public void addToFreelanceBooksList (org.insia.smartposse.mapping.FreelanceBooks freelanceBooks) {
		if (null == getFreelanceBooksList()) setFreelanceBooksList(new java.util.TreeSet<org.insia.smartposse.mapping.FreelanceBooks>());
		getFreelanceBooksList().add(freelanceBooks);
	}



	/**
	 * Return the value associated with the column: FreelanceSkillsList
	 */
	public java.util.Set<org.insia.smartposse.mapping.FreelanceSkills> getFreelanceSkillsList () {
		return freelanceSkillsList;
	}

	/**
	 * Set the value related to the column: FreelanceSkillsList
	 * @param freelanceSkillsList the FreelanceSkillsList value
	 */
	public void setFreelanceSkillsList (java.util.Set<org.insia.smartposse.mapping.FreelanceSkills> freelanceSkillsList) {
		this.freelanceSkillsList = freelanceSkillsList;
	}

	public void addToFreelanceSkillsList (org.insia.smartposse.mapping.FreelanceSkills freelanceSkills) {
		if (null == getFreelanceSkillsList()) setFreelanceSkillsList(new java.util.TreeSet<org.insia.smartposse.mapping.FreelanceSkills>());
		getFreelanceSkillsList().add(freelanceSkills);
	}



	/**
	 * Return the value associated with the column: ProjectList
	 */
	public java.util.Set<org.insia.smartposse.mapping.Projects> getProjectList () {
		return projectList;
	}

	/**
	 * Set the value related to the column: ProjectList
	 * @param projectList the ProjectList value
	 */
	public void setProjectList (java.util.Set<org.insia.smartposse.mapping.Projects> projectList) {
		this.projectList = projectList;
	}

	public void addToProjectList (org.insia.smartposse.mapping.Projects projects) {
		if (null == getProjectList()) setProjectList(new java.util.TreeSet<org.insia.smartposse.mapping.Projects>());
		getProjectList().add(projects);
	}



	/**
	 * Return the value associated with the column: JobProjectList
	 */
	public java.util.Set<org.insia.smartposse.mapping.JobProject> getJobProjectList () {
		return jobProjectList;
	}

	/**
	 * Set the value related to the column: JobProjectList
	 * @param jobProjectList the JobProjectList value
	 */
	public void setJobProjectList (java.util.Set<org.insia.smartposse.mapping.JobProject> jobProjectList) {
		this.jobProjectList = jobProjectList;
	}

	public void addToJobProjectList (org.insia.smartposse.mapping.JobProject jobProject) {
		if (null == getJobProjectList()) setJobProjectList(new java.util.TreeSet<org.insia.smartposse.mapping.JobProject>());
		getJobProjectList().add(jobProject);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.insia.smartposse.mapping.Users)) return false;
		else {
			org.insia.smartposse.mapping.Users users = (org.insia.smartposse.mapping.Users) obj;
			if (null == this.getId() || null == users.getId()) return false;
			else return (this.getId().equals(users.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}